package com.gupaoedu.vip.factory.simple;

import com.gupaoedu.vip.factory.CocaCola;
import com.gupaoedu.vip.factory.Drink;
import com.gupaoedu.vip.factory.PepsiCola;
import com.gupaoedu.vip.factory.Sprite;

/**
 * Created by zhaozhonghai on 2017/5/23.
 */
public class SimpleFactory {
    public Drink getDrink(String name){
        Drink drink=null;
        if ("cocaCola".equalsIgnoreCase(name)){
            drink=new CocaCola();
        }else if ("pepsiCola".equalsIgnoreCase(name)){
            drink=new PepsiCola();
        }else if ("sprite".equalsIgnoreCase(name)){
            drink=new Sprite();
        }else {
            System.out.println("没有相应的生产工艺");
        }
        return drink;
    }
}
